<template>
	<div>
		<div class="container">
			<div class="handle-box">
				<el-select v-model="create_case.case_source" @change="getData('','',create_case.case_source,'')" clearable placeholder="案件来源" class="handle-select mr10">
					<el-option key="1" label="市场调查" value="市场调查"></el-option>
					<el-option key="2" label="举报" value="举报"></el-option>
				</el-select>
        <el-select v-model="create_case.case_type" @change="getData('','','',create_case.case_type)" clearable placeholder="案件性质" class="handle-select mr10">
          <el-option key="1" label="一般案件" value="一般案件"></el-option>
          <el-option key="2" label="简易案件" value="简易案件"></el-option>
        </el-select>
				<el-input v-model="query.id" placeholder="案件号" class="handle-input mr10"></el-input>
				<el-button type="primary" :icon="Search" @click="handleSearch">搜索</el-button>
				<el-button type="primary" :icon="Plus" @click="create">启动执法流程 </el-button>
			</div>
			<el-table :data="tableList" border class="table" ref="multipleTable" header-cell-class-name="table-header">
				<el-table-column prop="case_id" label="案件号" width="100" align="center"></el-table-column>

<!--        <el-table-column prop="date_of_archive" label="结案日期" align="center"></el-table-column>-->
<!--        <el-table-column prop="date_of_archive" label="归档日期"  align="center"></el-table-column>-->
        <el-table-column prop="case_source" label="案件来源" align="center"></el-table-column>
        <el-table-column prop="case_number" label="立案编号"  align="center"></el-table-column>
<!--        <el-table-column prop="archive_person" label="归档人" align="center"></el-table-column>-->
        <el-table-column prop="case_update_time" label="更新时间"  align="center"></el-table-column>
        <el-table-column prop="case_type" label="案件性质" align="center"></el-table-column>
        <el-table-column prop="date_of_filing" label="立案日期"  align="center"></el-table-column>
<!--        <el-table-column label="案件状态" align="center" width="230">-->
<!--          <template #default="scope">-->
<!--            <el-tag-->
<!--                :type="scope.row.tcs_note_id === '已完成' ? 'success' : scope.row.tcs_note_id === '错误' ? 'danger' : ''"-->
<!--            >-->
<!--              {{ scope.row.tcs_note_id }}-->
<!--            </el-tag>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column prop="case_remark" label="备注"  align="center"></el-table-column>-->
				<el-table-column label="下一步操作" width="230" align="center">
					<template #default="scope">
              <div v-if="scope.row.tcs_note_id === '创建案件已完成' ">
                <el-button  text :icon="Edit" class="blue" @click="case_legal_tabel(scope.row)" v-permiss="15">
                  涉案卷烟信息录入
                </el-button>
              </div>
            <div v-if="scope.row.tcs_note_id === '涉案卷烟信息录入已完成' ">
              <el-button text :icon="Edit" class="blue" @click="evidence_collection_tabel(scope.row)" v-permiss="15">
                证据采集
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '证据采集已完成' ">
              <el-button text :icon="Edit" class="blue" @click="ratification_tabel(scope.row)" v-permiss="15">
                证据先行保存批准书填写
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '证据先行保存批准书已完成' ">
              <el-button text :icon="Edit" class="blue" @click="ratification_review_tabel(scope.row)" v-permiss="15">
                证据先行保存通知书审核
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '证据先行保存通知书审核已完成' ">
              <el-button text :icon="Edit" class="blue" @click="advice_note_tabel(scope.row)" v-permiss="15">
                证据先行保存通知书上传
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '证据先行保存通知书上传已完成' ">
              <el-button text :icon="Edit" class="blue" @click="inspection_record_tabel(scope.row)" v-permiss="15">
                现场勘验笔录填写
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '现场勘验笔录已完成' ">
              <el-button text :icon="Edit" class="blue" @click="printing_record_tabel(scope.row)" v-permiss="15">
                喷码记录表填写
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '喷码记录表已完成' ">
              <el-button text :icon="Edit" class="blue" @click="filing_Report_tabel(scope.row)" v-permiss="15">
                立案报告表填写
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '立案报告表已完成' ">
              <el-button text :icon="Edit" class="blue" @click="filing_Report_review_tabel(scope.row)" v-permiss="15">
                立案报告表审核
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '立案报告表审核已完成' ">
                <el-button text :icon="Edit" class="blue" @click="cigarette_identification_tabel(scope.row)" v-permiss="15">
                  卷烟鉴别书填写
                </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '卷烟鉴别书已完成' ">
              <el-button text :icon="Edit" class="blue" @click="price_list_tabel(scope.row)" v-permiss="15">
                涉案烟草价品核案表
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '涉案烟草价品核案表完成' ">
              <el-button text :icon="Edit" class="blue" @click="cranscript_of_questioning_tabel(scope.row)" v-permiss="15">
                询问笔录填写
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '询问笔录已完成' ">
              <div v-if="scope.row.mer_flag === '是' ">
                <el-button text :icon="Edit" class="blue" @click="without_license_tabel(scope.row)" v-permiss="15">
                  无证经营许可证填写
                </el-button>
              </div>
              <div v-if="scope.row.mer_flag !== '是'  ">
                <el-button text :icon="Edit" class="blue" @click="end_document_tabel(scope.row)" v-permiss="15">
                  调查终结文书填写
                </el-button>
              </div>
            </div>
            <div v-if="scope.row.tcs_note_id === '无证经营公示已完成'  ">
              <el-button text :icon="Edit" class="blue" @click="end_document_tabel(scope.row)" v-permiss="15">
                调查终结文书填写
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '已完成'  ">
              <el-tag :type="'success'">
                案件已完成
              </el-tag>
            </div>
					</template>
				</el-table-column>
			</el-table>
			<div class="pagination">
				<el-pagination
					background
					layout="total, prev, pager, next"
					:current-page="query.pageIndex"
					:page-size="query.pageSize"
					:total="pageTotal"
					@current-change="handlePageChange"
				></el-pagination>
			</div>
		</div>



<!--    流程界面-->
    <el-dialog title="启动执法流程"  v-model="Create_Visible" width="30%">
      <el-form label-width="140px">
        <el-form-item label="立案日期">
          <el-date-picker v-model="create_case.date_of_filing" type="datetime" placeholder="选择案发日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>

        <el-form-item label="案件来源">
          <el-select  v-model="create_case.case_source" clearable filterable placeholder="请选择案件来源">
            <el-option key="1" label="市场调查" value="市场调查"></el-option>
            <el-option key="2" label="举报" value="举报"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="案件性质" >
          <el-select  v-model="create_case.case_type" clearable filterable placeholder="请选择案件来源">
            <el-option key="1" label="民事案件" value="民事案件"></el-option>
            <el-option key="2" label="刑事案件" value="刑事案件"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="工商执照号" >
          <el-input v-model="create_case.retail_licence_code" @change="get_mer_searsh('','','','',create_case.retail_licence_code)" placeholder="请输入工商执照号"></el-input>
        </el-form-item>
        <el-form-item label="商户名称" >
          <el-input v-model="create_case.mer_name" disabled placeholder="商户名称"></el-input>
        </el-form-item>
        <el-form-item label="商户负责人名称" >
          <el-input v-model="create_case.mer_person" disabled placeholder="商户负责人名称"></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
				<span class="dialog-footer">
          <el-button type="primary" @click="mer_search">创建案件</el-button>
          <el-button @click="Create_Visible = false">取 消</el-button>
				</span>
      </template>
    </el-dialog>

<!--    新增未入库的商户-->
    <el-dialog title="增加新商户"  v-model="Create_mer_Visible" width="30%">
      <el-form label-width="140px">
        <el-form-item label="经营业态">
          <el-input v-model="create_case.mer_format"></el-input>
        </el-form-item>
        <el-form-item label="商户名称">
          <el-input v-model="create_case.mer_name"></el-input>
        </el-form-item>
        <el-form-item label="经营地址">
          <el-input v-model="create_case.mer_address"></el-input>
        </el-form-item>
        <el-form-item label="商户负责人名称">
          <el-input v-model="create_case.mer_record"></el-input>
        </el-form-item>
        <el-form-item label="记录者">
          <el-input v-model="create_case.mer_record"></el-input>
        </el-form-item>
        <el-form-item label="记录日期">
          <el-date-picker v-model="create_case.date_of_record" type="datetime" placeholder="选择日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="许可证有效日期">
          <el-date-picker v-model="create_case.date_of_effect" type="datetime" placeholder="选择日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="发证日期">
          <el-date-picker v-model="create_case.date_of_issue" type="datetime" placeholder="选择日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="商户负责人籍贯">
          <el-input v-model="create_case.mer_hometown"></el-input>
        </el-form-item>
        <el-form-item label="商户负责人身份证号">
          <el-input v-model="create_case.mer_id_number"></el-input>
        </el-form-item>
        <el-form-item label="商户负责人联系电话">
          <el-input v-model="create_case.mer_tel"></el-input>
        </el-form-item>
        <el-form-item label="工商执照号">
          <el-input v-model="create_case.business_licence_code"></el-input>
        </el-form-item>
        <el-form-item label="证件状态">
          <el-input v-model="create_case.licence_state"></el-input>
        </el-form-item>
        <el-form-item label="仓储地址">
          <el-input v-model="create_case.storage_address"></el-input>
        </el-form-item>
        <el-form-item label="烟草专卖零售许可证">
          <el-input v-model="create_case.retail_licence_code"></el-input>
        </el-form-item>
        <el-form-item label="持证类型">
          <el-input v-model="create_case.category"></el-input>
        </el-form-item>
        <el-form-item label="区域ID">
          <el-input v-model="create_case.area_id"></el-input>
        </el-form-item>
        <el-form-item label="邮政编码">
          <el-input v-model="create_case.mer_zip_code"></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Create_mer_Visible = false">取 消</el-button>
          <el-button @click="Create_mer_Visible = false">确 定</el-button>
					<el-button type="primary" @click="mer_evi">输入案由及证据先行保存通知书编号</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="输入案由及证据先行保存通知书编号" v-model="Case_legal_Visible"  width="30%">
      <el-form label-width="140px">
        <el-form-item label="请选择涉嫌案由">
          <el-select v-model="create_case.illegal_behavior" @change="get_legal_clause_opinion(create_case.illegal_behavior)"
                     clearable filterable placeholder="请选择涉嫌案由" >
            <el-option
                v-for="item in illegal_Data"
                :key="item.illegal_behavior"
                :label="item.illegal_behavior"
                :value="item.illegal_behavior"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="请选择案件级别">
          <el-select v-model="create_case.standard"  clearable filterable placeholder="请选择案件级别">
            <el-option
                v-for="item in illegal_Data"
                :key="item.standard"
                :label="item.standard"
                :value="item.standard"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="请输入证据先行保存通知书编号">
          <el-input v-model="create_case.evi_id_number" placeholder="请输入证据先行保存通知书编号">
          </el-input>
        </el-form-item>
        <el-form-item label="请输入证据保存地点">
          <el-input v-model="create_case.tce_address" placeholder="请输入证据保存地点">
          </el-input>
        </el-form-item>
      </el-form>
      <template #footer>
				<span class="dialog-footer">
					<el-button type="primary" @click="case_legal">开始录入卷烟信息</el-button>
          <el-button @click="Case_legal_Visible = false">取 消</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="输入涉案卷烟信息" v-model="Case_cigrate_Visible" align="center" width="70%">
      <el-form label-width="70px">
        <el-form-item label="条形码">
          <el-input v-model="create_case.barcode"  @change="get_ciga_searsh_barcode(create_case.barcode)"></el-input>
        </el-form-item>
        <el-form-item label="卷烟品种">
          <el-input v-model="create_case.ciga_variety" disabled ></el-input>
        </el-form-item>
        <el-form-item label="规格型号">
          <el-input v-model="create_case.ciga_model" disabled ></el-input>
        </el-form-item>
        <el-form-item label="卷烟价格">
          <el-input v-model="create_case.ciga_price" disabled ></el-input>
        </el-form-item>
        <el-form-item label="卷烟数量">
          <el-input v-model="create_case.evi_number"  placeholder="请输入涉案卷烟数量"></el-input>
        </el-form-item>
        <el-form-item label="卷烟喷码">
          <el-input v-model="create_case.inkjet" placeholder="请输入涉案卷烟喷码"></el-input>
        </el-form-item>
      </el-form>
      <el-table :data="evidence_ciga_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="ciga_variety" label="烟草种类"  align="center"></el-table-column>
        <el-table-column prop="ciga_model" label="烟草规格"  align="center"></el-table-column>
        <el-table-column prop="evi_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="inkjet" label="烟草喷码"  align="center"></el-table-column>
        <el-table-column prop="evi_id_number" label="证据先行保存通知书编号"  align="center"></el-table-column>
      </el-table>
      <div v-if="evidence_ciga_Data.length < 9" align="right" >
        <el-button type="primary" @click="ciga_case_plus">继续录入卷烟</el-button>
      </div>
      <template #footer>
				<span class="dialog-footer">

					<el-button type="primary" @click="ciga_case_plus_3">完成录入</el-button>
          <el-button type="primary" @click="ciga_case_plus_1">录入新先行保存通知书</el-button>
          <el-button type="primary" @click="ciga_case_plus_2">证据采集</el-button>
          <el-button @click="Case_cigrate_Visible = false">取 消</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="证据采集" v-model="Evidence_collection_Visible" width="35%">
      <el-form label-width="200px">
        <el-form-item label="门头照片" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=1
                     accept="bmp, jpg, png, gif, jpeg"
                     :http-request="up_load1"
                     :show-file-list="false" >
            <el-image
                style="width: 200px;height: 200px"
                :src="evi_img_data.img_1"
                :preview-src-list=[evi_img_data.img_1]
            ></el-image>
          </el-upload>
        </el-form-item>
        <el-form-item label="点击上传出示执法证照片" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=1
                     accept="bmp, jpg, png, gif, jpeg"
                     :http-request="up_load2"
                     :show-file-list="false" >
            <el-image
                style="width: 200px;height: 200px"
                :src="evi_img_data.img_2"
                :preview-src-list=[evi_img_data.img_2]
            ></el-image>
          </el-upload>
        </el-form-item>
        <el-form-item label="点击上传卷烟原始位置照片" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=1
                     accept="bmp, jpg, png, gif, jpeg"
                     :http-request="up_load3"
                     :show-file-list="false" >
            <el-image
                style="width: 200px;height: 200px"
                :src="evi_img_data.img_3"
                :preview-src-list=[evi_img_data.img_3]
            ></el-image>
          </el-upload>

        </el-form-item>
        <el-form-item label="点击上传指认照片" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=1
                     accept="bmp, jpg, png, gif, jpeg"
                     :http-request="up_load4"
                     :show-file-list="false" >
            <el-image
                style="width: 200px;height: 200px"
                :src="evi_img_data.img_4"
                :preview-src-list=[evi_img_data.img_4]
            ></el-image>
          </el-upload>

        </el-form-item>
        <el-form-item label="点击上传经营许可证照片" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=1
                     accept="bmp, jpg, png, gif, jpeg"
                     :http-request="up_load5"
                     :show-file-list="false" >
            <el-image
                style="width: 200px;height: 200px"
                :src="evi_img_data.img_5"
                :preview-src-list=[evi_img_data.img_5]
            ></el-image>
          </el-upload>

        </el-form-item>
        <el-form-item label="点击上传签字照片" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=1
                     accept="bmp, jpg, png, gif, jpeg"
                     :http-request="up_load6"
                     :show-file-list="false" >
            <el-image
                style="width: 200px;height: 200px"
                :src="evi_img_data.img_6"
                :preview-src-list=[evi_img_data.img_6]
            ></el-image>
          </el-upload>

        </el-form-item>
        <el-form-item label="点击上传其他照片" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=1
                     accept="bmp, jpg, png, gif, jpeg"
                     :http-request="up_load7"
                     :show-file-list="false" >
            <el-image
                style="width: 200px;height: 200px"
                :src="evi_img_data.img_7"
                :preview-src-list=[evi_img_data.img_7]
            ></el-image>
          </el-upload>

        </el-form-item>

      </el-form>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Evidence_collection_Visible = false">取 消</el-button>
					<el-button type="primary" @click="ratification">证据先行保存批准书填写</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="证据先行保存批准书填写" v-model="Ratification_Visible" width="70%" >
      <el-table :data="evidence_case_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="case_id" label="案件号"  align="center"></el-table-column>
        <el-table-column prop="evi_id_number" label="证据先行保存批准书编号"  width="200" align="center"></el-table-column>
        <el-table-column prop="tce_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="tce_amount" label="烟草价值"  align="center"></el-table-column>
        <el-table-column label="操作" width="220" align="center">
          <template #default="scope">
            <el-button text :icon="Edit" @click="create_evi_word(scope.row)" v-permiss="1">
              打 印
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Ratification_Visible = false">取 消</el-button>
          <el-button type="primary" @click="ratification_review">证据先行保存批准书审核</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="证据先行保存批准书审核" v-model="Ratification_review_Visible" width="70%" >

      <el-table :data="evidence_case_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="case_id" label="案件号"  align="center"></el-table-column>
        <el-table-column prop="evi_id_number" label="证据先行保存批准书编号"  width="200" align="center"></el-table-column>
        <el-table-column prop="tce_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="tce_amount" label="烟草价值"  align="center"></el-table-column>
        <el-table-column label="操作" width="220" align="center">
          <template #default="scope">
            <el-button text :icon="Edit" @click="create_evi_word(scope.row)" v-permiss="1">
              打 印
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-form label-width="140px">

        <el-form-item label="审核意见">
          <el-select v-model="create_case.case_remark"  placeholder="请输入审核意见" class="handle-select mr10">
            <el-option key="1" label="通过" value="通过"></el-option>
            <el-option key="2" label="不通过" value="不通过"></el-option>
          </el-select>
        </el-form-item>

      </el-form>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Ratification_review_Visible = false">取 消</el-button>
					<el-button type="primary" @click="advice_note">证据先行保存通知书上传</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="证据先行保存通知书上传" v-model="Advice_note_Visible" width="34%">
      <el-form label-width="0px">
        <el-form-item label="" >
          <el-upload class="upload-demo" action="http://jsonplaceholder.typicode.com/api/posts/">
            点击上传证据先行保存通知书
          </el-upload>
        </el-form-item>
      </el-form>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Advice_note_Visible = false">取 消</el-button>
					<el-button type="primary" @click="inspection_record">现场勘验笔录填写</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="现场勘验笔录填写" v-model="Inspection_record_Visible" width="70%">
      <el-table :data="evidence_case_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="case_id" label="案件号"  align="center"></el-table-column>
        <el-table-column prop="evi_id_number" label="证据先行保存批准书编号"  width="200" align="center"></el-table-column>
        <el-table-column prop="tce_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="tce_amount" label="烟草价值"  align="center"></el-table-column>
        <el-table-column label="操作" width="220" align="center">
          <template #default="scope">
            <el-button text :icon="Edit" @click="create_evi_word(scope.row)" v-permiss="1">
              打 印
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <template #footer>
				<span class="dialog-footer">

          <div v-if="create_case.case_cause !== '真烟' ">
              <el-button @click="Inspection_record_Visible = false">取 消</el-button>
            <el-button type="primary" @click="filing_Report">立案报告表填写</el-button>
          </div>
          <div v-if="create_case.case_cause === '真烟' ">
              <el-button @click="Inspection_record_Visible = false">取 消</el-button>
           <el-button type="primary" @click="printing_record">喷码记录表填写</el-button>
          </div>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="喷码记录表打印" v-model="Printing_record_Visible" width="70%">
      <el-table :data="evidence_case_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="case_id" label="案件号"  align="center"></el-table-column>
        <el-table-column prop="evi_id_number" label="证据先行保存批准书编号"  width="200" align="center"></el-table-column>
        <el-table-column prop="tce_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="tce_amount" label="烟草价值"  align="center"></el-table-column>
        <el-table-column label="操作" width="220" align="center">

          <template #default="scope">
            <el-button text :icon="Edit" @click="create_inkjet_word(scope.row)" v-permiss="1">
              打 印
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Printing_record_Visible = false">取 消</el-button>
					<el-button type="primary" @click="filing_Report">立案报告表填写</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="立案报告表填写" v-model="Filing_Report_Visible" width="70%">
      <el-table :data="evidence_case_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="case_id" label="案件号"  align="center"></el-table-column>
        <el-table-column prop="evi_id_number" label="证据先行保存批准书编号"  width="200" align="center"></el-table-column>
        <el-table-column prop="tce_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="tce_amount" label="烟草价值"  align="center"></el-table-column>
      </el-table>
      <template #footer>
				<span class="dialog-footer" >
					<el-button @click="Filing_Report_Visible = false">取 消</el-button>
          <el-button type="primary" @click="illegal_record_word(create_case.case_id)">立案报告表打印</el-button>
					<el-button type="primary" @click="filing_Report_review">立案报告表审核</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="立案报告表审核" v-model="Filing_Report_review_Visible" width="70%">
      <el-table :data="evidence_case_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="case_id" label="案件号"  align="center"></el-table-column>
        <el-table-column prop="evi_id_number" label="证据先行保存批准书编号"  width="200" align="center"></el-table-column>
        <el-table-column prop="tce_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="tce_amount" label="烟草价值"  align="center"></el-table-column>
      </el-table>
      <el-form label-width="140px">
        <el-form-item label="审核意见">
          <el-select v-model="create_case.case_remark"  placeholder="请输入审核意见" class="handle-select mr10">
            <el-option key="1" label="通过" value="通过"></el-option>
            <el-option key="2" label="不通过" value="不通过"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer >
				<span class="dialog-footer">

          <div v-if="create_case.ciga_num_flag === '是' ">
              <el-button @click="Filing_Report_review_Visible = false" >取 消</el-button>
          <el-button type="primary"  @click="illegal_record_word(create_case.case_id)">立案报告表打印</el-button>
            <el-button type="primary" @click="cigarette_identification">卷烟鉴别书填写</el-button>
          </div>
          <div v-if="create_case.ciga_num_flag !=='是' ">
              <el-button @click="Filing_Report_review_Visible = false" >取 消</el-button>
          <el-button type="primary"  @click="illegal_record_word(create_case.case_id)">立案报告表打印</el-button>
           <el-button type="primary" @click="price_list">核价表填写</el-button>
          </div>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="卷烟鉴别书填写" v-model="Cigarette_identification_Visible" width="30%">
      <el-form label-width="140px">
        <el-form-item label="选择送检人员" >
          <el-select v-model="create_case.staff_evi_send_per"
                     clearable filterable placeholder="选择送检人员">
            <el-option
                v-for="item in staff_Data"
                :key="item.staff_name"
                :label="item.staff_name"
                :value="item.staff_name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="选择鉴别人员1" >
          <el-select v-model="create_case.staff_evi_check_per1"
                     clearable filterable placeholder="选择鉴别人员1">
            <el-option
                v-for="item in staff_Data"
                :key="item.staff_name"
                :label="item.staff_name"
                :value="item.staff_name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="选择鉴别人员2" >
          <el-select v-model="create_case.staff_evi_check_per2"
                     clearable filterable placeholder="选择鉴别人员2">
            <el-option
                v-for="item in staff_Data"
                :key="item.staff_name"
                :label="item.staff_name"
                :value="item.staff_name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="送检时间">
          <el-date-picker v-model="create_case.staff_evi_send_time" type="datetime" placeholder="选择日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="送检单位">
          <el-input v-model="create_case.staff_evi_send_unit"></el-input>
        </el-form-item>
        <el-form-item label="送检结果">
          <el-select  v-model="create_case.staff_evi_send_result" clearable filterable placeholder="请选择案件来源">
            <el-option key="1" label="真烟" value="真烟"></el-option>
            <el-option key="2" label="假烟" value="假烟"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="当事人是否确认">
          <el-select  v-model="create_case.staff_evi_per_note" clearable filterable placeholder="请选择案件来源">
            <el-option key="1" label="是" value="是"></el-option>
            <el-option key="2" label="否" value="否"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Cigarette_identification_Visible = false">取 消</el-button>
          <el-button type="primary" @click="staff_evi_create_print">录入并打印</el-button>
					<el-button type="primary" @click="price_list">核价表填写</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="核价表填写" v-model="Price_list_Visible" width="70%" height="70%">
      <el-table :data="evidence_ciga_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="case_id" label="案件" width="70"  align="center"></el-table-column>
        <el-table-column prop="ciga_variety" label="品种"  width="100" align="center"></el-table-column>
        <el-table-column prop="barcode" label="条形码"  align="center"></el-table-column>
        <el-table-column prop="ciga_model" label="规格型号"  align="center"></el-table-column>
        <el-table-column prop="evi_number" label="数量(条)" width="100" align="center"></el-table-column>
        <el-table-column prop="ciga_price" label="单价(元)"  align="center"></el-table-column>
        <el-table-column label="下一步操作" width="230" align="center">
          <template #default="scope">
            <el-button  text :icon="Edit" class="blue" @click="case_legal_tabel(scope.row)" v-permiss="15">
              修改价格
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <template #footer>

				<span class="dialog-footer">
					<el-button @click="Price_list_Visible = false">取 消</el-button>
                    <el-button type="primary" @click="review_price_word(create_case.case_id)">打印</el-button>
					<el-button type="primary" @click="cranscript_of_questioning">询问笔录填写</el-button>
				</span>
      </template>
    </el-dialog>
    <el-dialog title="询问笔录填写" v-model="Transcript_of_questioning_Visible" width="60%">
      <el-form ref="form"  :model="form" label-width="100px">
          <el-form-item label="立案日期">
              <el-date-picker  type="datetime" placeholder="选择案发日期" value-format="YYYY-MM-DD HH:mm:ss">
              </el-date-picker>
          </el-form-item>
        <el-form-item label="询问地点">
          <el-input v-model="create_case.tce_address"></el-input>
        </el-form-item>
        <el-row>
          <el-col :span="8">
            <el-form-item label="询问人">
              <el-select v-model="create_case.interrogator" @change="get_interrogator_clause_opinion(create_case.interrogator)" clearable filterable placeholder="请选择">
                <el-option
                        v-for="(item,index) in interrogator_Data"
                        :key='index'
                        :label='item.name'
                        :value='item.name'
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="记录人">
              <el-select v-model="create_case.recorder" @change="get_recorder_clause_opinion(create_case.recorder)" clearable filterable placeholder="请选择">
                <el-option
                        v-for="(item,index) in recorder_Data"
                        :key='index'
                        :label='item.name'
                        :value='item.name'
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="被询问人">
              <el-input v-model="create.staff_name"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="6">
            <el-form-item label="性别">
              <el-select v-model=" create.staff_gender" placeholder="请选择" class="handle-select mr10">
                <el-option key="1" label="男" value="男" ></el-option>
                <el-option key="2" label="女" value="女"></el-option>
              </el-select>
            </el-form-item>
          </el-col >

          <el-col :span="6">
            <el-form-item label="民族">
              <el-input v-model="create_case.staff_ethnicity"></el-input>
            </el-form-item>
          </el-col>
            <el-col :span="12">
            <el-form-item label="身份证号码" >
<!--              <el-select  placeholder="请选择"  class="handle-select mr10"></el-select>-->
                    <el-input v-model="create_case.tir_id_number"></el-input>
            </el-form-item>
            </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="住址">
              <el-input v-model="form.name"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="经营地址">
              <el-input v-model="form.name"></el-input>
            </el-form-item>
          </el-col>

        </el-row>
        <el-form-item label="确认记录">
          <el-input type="textarea" rows="2" :disabled="true" v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="告知权利">
          <el-input type="textarea" rows="3" :disabled="true"  model-value="根据《烟草专卖行政处罚程序规定》第二十条、第二十六条第一款的规定，你应当如实回答询问，不得提供伪证或隐匿证据，否则将承担相应的法律责任，同时你依法享有陈述权、申辩权和申请办案人员回避的权利。请问你是否清楚？是否申请回避？"></el-input>
        </el-form-item>
        <el-form-item label="被询问人">
          <el-input type="textarea" rows="1" :disabled="true"  model-value="我听清楚了，愿意接受你们的询问"></el-input>
        </el-form-item>
        <el-row>


        </el-row>
        <el-row :gutter="24">
          <el-col :span="6">
        <el-form-item label="问" >
          <el-select v-model="create_case.question" @change="get_question_clause_opinion(create_case.question)" clearable filterable placeholder="请选择">
            <el-option
                    v-for="item in question_Data"
                    :key="item.id"
                    :label="item.question"
                    :value="item.question"
            ></el-option>
          </el-select>
        </el-form-item>
          </el-col >
            <div  align="right">
                <el-button type="primary"  @click="question_answer_add">继续录入问题</el-button>
            </div>
        </el-row>

        <el-form-item label="答">
          <el-input type="textarea" rows="3"  v-model="create_case.answer" ></el-input>
        </el-form-item>
      </el-form>

        <el-table :data="question_answer_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header" >
<!--            <el-table-column prop="id" label="序号"  width="55px" align="center"></el-table-column>-->
            <el-table-column prop="question" label="问"   align="center"></el-table-column>
            <el-table-column prop="answer" label="答"   align="center"></el-table-column>

            <el-table-column label="操作" width="193px" align="center">
                <template #default="scope">
                    <el-button text :icon="Edit" @click="handleEdit(scope.$index, scope.row)" v-permiss="1">
                        修改
                    </el-button>
                    <el-button text :icon="Delete" class="red" @click="question_answer_delete(scope.$index,scope.row)" v-permiss="16">
                        删除
                    </el-button>
                </template>
            </el-table-column>
        </el-table>

      <template #footer>
				<span class="dialog-footer">


          <div v-if="create_case.case_cause !== '经营许可证' ">
            <el-button @click="Transcript_of_questioning_Visible = false">取 消</el-button>
             <el-button type="primary" @click="inquiry_record_print(create_case.case_id)">打印</el-button>
            <el-button type="primary" @click="without_license">无证经营公示</el-button>
          </div>
          <div v-if="create_case.case_cause === '经营许可证' ">
            <el-button @click="Transcript_of_questioning_Visible = false">取 消</el-button>
            <el-button type="primary" @click="inquiry_record_print(create_case.case_id)">打印</el-button>
           <el-button type="primary" @click="end_document">调查终结文书填写</el-button>
          </div>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="无证经营公示" v-model="Without_license_Visible" width="30%">
      <el-form label-width="70px">
        <el-form-item label="案件号">
          <el-input v-model="create_case.case_id" ></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Without_license_Visible = false">取 消</el-button>
					<el-button type="primary" @click="end_document">调查终结文书填写</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="调查终结文书填写" v-model="End_document_Visible" width="90%" >

      <el-table :data="end_record_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header" >
        <el-table-column prop="illegal_behavior" label="案由"   align="center"></el-table-column>
        <el-table-column  label="案发地点"   align="center">闽侯县上街镇金屿村余盛13号（刘昌时宅）</el-table-column>
      </el-table>
      <el-table :data="end_record_Data"  border class="table" ref="multipleTable" header-cell-class-name="table-header"  >
        <el-table-column prop="date_of_filing"  label="立案日期"   align="center"></el-table-column>
        <el-table-column  prop="case_number" label="立案编号"   align="center"></el-table-column>
        <el-table-column  prop="mer_person" label="当事人"   align="center"></el-table-column>
        <el-table-column   label="调查人"   align="center">潘铭、刘刚</el-table-column>
      </el-table>
      <el-table :data="end_record_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header" >
        <el-table-column  prop="mer_id_number" label="身份证号"   align="center"></el-table-column>
        <el-table-column  prop="retail_licence_code" label="烟草专卖许可证号"   align="center"></el-table-column>
      </el-table>
      <el-table :data="end_record_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header" >
        <el-table-column  prop="mer_hometown" label="住址"   align="center"></el-table-column>
        <el-table-column  label="电话"   align="center">14523648965</el-table-column>
      </el-table>
      <el-table :data="end_record_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header" >
        <el-table-column  prop="source_investigate" label="案件来源及调查经过"   ></el-table-column>
        <el-table-column prop="illegal_evidence" label="违法事实与证据"   ></el-table-column>
      </el-table>
      <el-table  :data="end_record_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header" >
        <el-table-column prop="punish_basis" label="处罚依据"  ></el-table-column>
        <el-table-column prop="undertaker_opinion"  label="承办人意见"  ></el-table-column>
      </el-table>

      <template #footer>
				<span class="dialog-footer">
					<el-button @click="End_document_Visible = false">取 消</el-button>
          <el-button type="primary" @click="end_record_print(create_case.case_id)">打印</el-button>
					<el-button type="primary" @click="end">结束</el-button>
				</span>
      </template>
    </el-dialog>

  </div>
</template>

<script setup lang="ts" name="basetable">
import { ref, reactive } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { Delete, Edit, Search, Plus } from '@element-plus/icons-vue';
import {
  case_evi_Create,
  case_evi_Views,
  case_legal_Create,
  ciga_evudence_Create,
  end_record_data,
  evi_Views,
  record_inquiry_data,
  fetchData_case,
  fetchData_case_Create,
  fetchData_case_update,
  fetchData_imgs,
  fetchData_legal_clause,
  fetchData_mer,
  fetchData_s_mongodb_evidence_Cre,
  fetchData_s_mongodb_evidence_Views,
  fetchData_tobacco,
  fetchData_user,
  illegal_record_data,
  illegal_record_Search,
  mer_Create,
  mer_search_api,
  review_price_data,
  staff_evidence_create,
  staff_evidence_data,
  end_record_show,
  record_inquiry_show,
  record_inquiry_print,
  question_answer_show,
  fetchData_question_clause,
  question_answer_Create,
  legal_clause_delete,
  question_answer_clause_delete,
  fetchData_interrogator_clause,
  fetchData_recorder_clause
} from '../api/index';
import {
  export_word_1,
  export_word_2,
  export_word_3,
  export_word_4,
  export_word_5,
  export_word_6,
  export_word_7,
  // export_word_8
} from './table_inquiry.vue'

//案件表数据
interface TableItem {
  case_id:number,
  date_of_filing:string,
  date_of_closing:string,
  date_of_archive:string,
  case_source:string,
  case_number:string,
  archive_person:string,
  case_update_time:string,
  ase_type:string,
  case_remark:string,
  tcs_note_id:string,
  ciga_flag:string,
  ciga_num_flag:string,
  mer_flag:string,
}
//获取商户数据用作选项框
interface mer_data {
  mer_id: number,
  mer_format: string,
  mer_address: string,
  mer_person: string,
  mer_record: string,
  date_of_record: string,
  date_of_effect: string,
  date_of_issue: string,
  mer_hometown: string,
  mer_id_number: string,
  mer_tel: string,
  business_licence_code: string,
  licence_state: string,
  storage_address: string,
  retail_licence_code: string,
  category: string,
  area_id: number,
  mer_zip_code: number,
  mer_name: string,
}
const mer_Data = ref<mer_data[]>([]);
const get_mer_opinion = (mer_name:string='',licence_state:string='',mer_person:string='' ,mer_id:number,business_licence_code:string='') =>{
  fetchData_mer(mer_name,licence_state,mer_person,mer_id,business_licence_code).then(res =>{
    mer_Data.value = res.data.data;
  })
}
get_mer_opinion();
const get_mer_searsh = (mer_name:string='',licence_state:string='',mer_person:string='' ,mer_id:number,retail_licence_code:string='') =>{
  create_case.mer_name = '';
  create_case.mer_person = '';
  fetchData_mer(mer_name,licence_state,mer_person,mer_id,retail_licence_code).then(res =>{
    create_case.mer_name = res.data.data[0].mer_name;
    create_case.mer_person = res.data.data[0].mer_person;
  })
}

interface staff_data{
  staff_name:string,
  staff_gender:string,
  staff_birthday:string,
  staff_ethnicity:string,
  staff_edu_bg:string,
  staff_email:string,
  field_staff_identity_card:string,
  staff_hometown:string,
  staff_degree:string,
  staff_political_status:string,
  staff_post:string,
  staff_account_no:string,
  staff_account_pwd:string,
  staff_starting_time:string,
  staff_authorized:string,
  staff_phone:string,
  staff_tel:string,
  staff_e_sign:string,
  staff_small_number:string,
  staff_license_no:string,
  staff_now_work_degree:string,
  staff_now_evaluate_degree:string,
}
const staff_Data = ref<staff_data[]>([]);
const get_staff_opinion1 = () =>{
  fetchData_user('','','').then(res=>{
    staff_Data.value = res.data.data;
  })
}



//获取卷烟信息数据用作选项框
interface ciga_data {
  ciga_id:number,
  ciga_type:string,
  ciga_variety:string,
  barcode:string,
  ciga_model:string,
  ciga_price:number,
}
const ciga_Data = ref<ciga_data[]>([]);
const get_ciga_opinion = (ciga_variety:string='' ,ciga_model:string='') =>{
  fetchData_tobacco('',ciga_variety,ciga_model).then(res =>{
    ciga_Data.value = res.data.data;
  })
}
get_ciga_opinion();
const get_ciga_searsh_barcode = (barcode:string="")=>{
  create_case.ciga_variety = '';
  create_case.ciga_model = '';
  create_case.ciga_price = 0;
fetchData_tobacco("",'','',barcode).then(res=>{
  create_case.ciga_variety = res.data.data[0].ciga_variety;
  create_case.ciga_model = res.data.data[0].ciga_model;
  create_case.ciga_price = res.data.data[0].ciga_price;
})
}


//获取案件信息数据用作选项框
interface illegal_data {
  tlc_id:number,
  illegal_behavior:string,
  standard:string,
  penalty_range:string,
  statutory_penalty:string,
  grade:string,
  remark:string,
}
const illegal_Data = ref<illegal_data[]>([]);
const get_legal_clause_opinion = (illegal_behavior:string='',standard:string='' ,grade:string='',tlc_id:number) =>{

  fetchData_legal_clause(illegal_behavior, standard,grade,tlc_id).then(res =>{
    illegal_Data.value = res.data.data;
  })
}
get_legal_clause_opinion()


//获取问题
interface question_data{
  id:number,
  question:string
}
const question_Data = ref<question_data[]>([]);
const get_question_clause_opinion=(id:number,question:string='')=>{
  fetchData_question_clause(id,question).then(res=>{

    question_Data.value=res.data.data
  })
}
get_question_clause_opinion()


//获取询问人
interface interrogator_data{
  id:number,
  state:string,
  name:string,
  sex:string,
  idcard:string,
  post:string
}
//获取询问者选择框
const interrogator_Data=ref<interrogator_data[]>([]);
const get_interrogator_clause_opinion=(id:number,state:string='',name:string='',sex:string='',idcard:string='',post:string='')=>{
  fetchData_interrogator_clause(id,state,name,sex,idcard,post).then(res=>{
    interrogator_Data.value=res.data.data
  })
}
get_interrogator_clause_opinion()

//获取记录人
interface recorder_data{
  id:number,
  state:string,
  name:string,
  sex:string,
  idcard:string,
  post:string
}
//获取记录人选择框
const recorder_Data=ref<recorder_data[]>();
const get_recorder_clause_opinion=(id:number,state:string='',name:string='',sex:string='',idcard:string='',post:string='')=>{
  fetchData_recorder_clause(id,state,name,sex,idcard,post).then(res=>{
    recorder_Data.value=res.data.data
  })
}
get_recorder_clause_opinion()


//案件暂存数据
const create_case = reactive({
  staff_evi_id:0,
  staff_id:0,
  staff_evi_send_per:'',
  staff_evi_check_per1:'',
  staff_evi_check_per2:'',
  staff_evi_send_time:'',
  staff_evi_send_unit:'',
  staff_evi_send_result:'',
  staff_evi_rec_address:'',
  staff_evi_status:'',
  staff_evi_per_note:'',
  staff_name:'',
  mer_flag:'',
  ciga_num_flag:'',
  ciga_flag:'',
  test:[],
  img_data:'',
  standard:'',
  tir_id:0,
  tlc_id:0,
  illegal_behavior:'',
  evi_id_number:'',
  date_of_filing:'',
  date_of_closing:'',
  date_of_archive:'',
  case_source:'',
  case_number:'',
  archive_person:'',
  case_update_time:'',
  case_type:'',
  case_remark:'',
  mer_id:0,
  tcs_note:'',
  case_id:0,
  tce_time:'',
  tce_number:0,
  tce_amount:0,
  tce_remark:'',
  tce_address:'福建省福州市闽侯县烟草专卖局',
  evi_number:0,//数量(条)
  ciga_variety:'',//品种
  barcode:'',//条形码
  ciga_model:'',//规格型号
  ciga_price:0,//单价
  inkjet:'',//
  mer_format:'',
  mer_address:'',
  mer_person:'',
  staff_ethnicity:'',
  mer_record:'',
  date_of_record:'',
  date_of_effect:'',
  date_of_issue:'',
  mer_hometown:'',
  mer_id_number:'',
  mer_tel:'',
  business_licence_code:'',
  licence_state:'',
  storage_address:'',
  retail_licence_code:'',
  category:'',
  area_id:0,
  mer_zip_code:0,
  mer_name:'',
  remark:'',
  question:'',//问题
  answer:'',//回答
  interrogator:'',//询问人
  recorder:'',//记录人
});
//获取图片（测试）
const get_img = () =>{
  fetchData_s_mongodb_evidence_Views().then(res=>{
    create_case.img_data = res.data.data[0].img;
    // console.log(create_case.img_data);
  })
}
const evi_img_data = reactive({
  img_1:'',
  img_2:'',
  img_3:'',
  img_4:'',
  img_5:'',
  img_6:'',
  img_7:'',
})
//上传照片（暂时不可用）
const up_load1 = (file) =>{
  var form = new FormData();
  form.append('format',file.file.type)
  form.append("file",file.file)
  form.append("case_number",create_case.case_number)
  form.append("type","门头照")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    evi_img_data.img_1 = res.data.data.img
  });
}
const up_load2 = (file) =>{
  var form = new FormData();
  form.append('format',file.file.type)
  form.append("file",file.file)
  form.append("case_number",create_case.case_number)
  form.append("type","执法证照片")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    evi_img_data.img_2 = res.data.data.img
  });
}
const up_load3 = (file) =>{
  var form = new FormData();
  form.append('format',file.file.type)
  form.append("file",file.file)
  form.append("case_number",create_case.case_number)
  form.append("type","卷烟原始位置照片")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    evi_img_data.img_3 = res.data.data.img
  });
}
const up_load4 = (file) =>{
  var form = new FormData();
  form.append('format',file.file.type)
  form.append("file",file.file)
  form.append("case_number",create_case.case_number)
  form.append("type","指认照片")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    evi_img_data.img_4 = res.data.data.img
  });
}
const up_load5 = (file) =>{
  var form = new FormData();
  form.append('format',file.file.type)
  form.append("file",file.file)
  form.append("case_number",create_case.case_number)
  form.append("type","经营许可证照片")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    evi_img_data.img_5 = res.data.data.img
  });
}
const up_load6 = (file) =>{
  var form = new FormData();
  form.append('format',file.file.type)
  form.append("file",file.file)
  form.append("case_number",create_case.case_number)
  form.append("type","签字照片")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    evi_img_data.img_6 = res.data.data.img
  });
}
const up_load7 = (file) =>{
  var form = new FormData();
  form.append('format',file.file.type)
  form.append("file",file.file)
  form.append("case_number",create_case.case_number)
  form.append("type","其他照片")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    evi_img_data.img_7 = res.data.data.img
  });
}



//视图/

const Create_Visible = ref(false);                             //基本信息视图
const Case_legal_Visible = ref(false);                         //新建案由通知书视图
const Create_mer_Visible = ref(false);                         //新建商户视图
const Case_cigrate_Visible = ref(false);                       //涉案卷烟视图
const Evidence_collection_Visible = ref(false);                //采集证据视图
const Ratification_Visible = ref(false);                       //批准书视图
const Ratification_review_Visible = ref(false);                //批准书审核视图
const Advice_note_Visible = ref(false);                        //通知书视图
const Inspection_record_Visible = ref(false);                  //现场勘验笔录视图
const Printing_record_Visible = ref(false);                    //喷码记录视图
const Filing_Report_Visible = ref(false);                      //立案报表视图
const Filing_Report_review_Visible = ref(false);               //立案报告表审核视图
const Cigarette_identification_Visible = ref(false);           //卷烟鉴别视图
const Price_list_Visible = ref(false);                         //核价表视图
const Transcript_of_questioning_Visible = ref(false);          //询问笔录视图
const Without_license_Visible = ref(false);                    //无证经营许可证视图
const End_document_Visible = ref(false);                       //调查终结文书视图


//启动按钮
const create = () =>{
  get_img();
  Create_Visible.value = true;
}
//创建案件按钮：是否选择商户，若未选择，跳转到商户创建界面
const mer_search = () =>{
    if (create_case.business_licence_code === ''){
      Create_Visible.value = false;
      Create_mer_Visible.value = true;
    }
    else {
      Create_Visible.value = false;
      create_case.tcs_note = '创建案件已完成';
      fetchData_case_Create(
          create_case.ciga_flag,
          create_case.mer_flag,
          create_case.business_licence_code,
          create_case.date_of_filing,
          create_case.date_of_closing,
          create_case.date_of_archive,
          create_case.case_source,
          create_case.case_number,
          create_case.archive_person,
          create_case.case_update_time,
          create_case.case_type,
          create_case.case_remark,
          create_case.tcs_note).then(res=>{
        create_case.case_id = res.data.data.case_id;
        if (res.data.message ==="success"){
          ElMessage.success(`添加成功`);
        }else {
          ElMessageBox.confirm('添加失败', '提示', {
            type: 'warning'
          })
        }
      });
      Case_legal_Visible.value = true;
    }
}
//创建商户按钮
const mer_evi = () =>{
  Create_mer_Visible.value = false;
  Case_cigrate_Visible.value = true;
  mer_Create(
      create_case.mer_format,
      create_case.mer_address,
      create_case.mer_person,
      create_case.mer_record,
      create_case.date_of_record,
      create_case.date_of_effect,
      create_case.date_of_issue,
      create_case.mer_hometown,
      create_case.mer_id_number,
      create_case.mer_tel,
      create_case.business_licence_code,
      create_case.licence_state,
      create_case.storage_address,
      create_case.retail_licence_code,
      create_case.category,
      create_case.area_id,
      create_case.mer_zip_code,
      create_case.mer_name,
  ).then(res=>{
    if (res.data.message ==="success"){
      ElMessage.success(`添加商户成功`);
    }else {
      ElMessageBox.confirm('添加失败', '提示', {
        type: 'warning'
      })
    }
  })
  create_case.business_licence_code = '创建案件已完成';
  fetchData_case_Create(
      create_case.business_licence_code,
      create_case.date_of_filing,
      create_case.date_of_closing,
      create_case.date_of_archive,
      create_case.case_source,
      create_case.case_number,
      create_case.archive_person,
      create_case.case_update_time,
      create_case.case_type,
      create_case.case_remark,
      create_case.tcs_note,).then(res=>{
        create_case.case_id = res.data.data.case_id;
        if (res.data.message ==="success"){
          ElMessage.success(`添加成功`);
        }else {
          ElMessageBox.confirm('添加失败', '提示', {
            type: 'warning'
          })
        }
  });
  Case_legal_Visible.value = true;
}
//添加案件号，案由，保存通知书对应表
const case_legal = () =>{
    case_legal_Create(
        create_case.illegal_behavior,
        create_case.standard,
        create_case.tlc_id,
        create_case.case_id,
        create_case.case_number,
        create_case.remark,
        create_case.evi_id_number,
    ).then(res=>{
      if (res.data.message ==="success"){
        ElMessage.success(`添加成功`);
      }else {
        ElMessageBox.confirm('添加失败', '提示', {
          type: 'warning'
        })
      }
    });
  Case_legal_Visible.value = false;
  Case_cigrate_Visible.value = true;
}
//通过案件号查询所有证据先行保存通知书
interface Evidence_case_data {
  case_id:number,//案件号
  evi_id_number:string,
  evi_number:number,
  tce_time_year:string,//案件时间
  tce_time_month:string,
  tce_time_day:string,
  tce_type_number:string,
  tce_number:string,
  tce_amount:number,
  tce_remark:string,
  tce_address:string,
}
const evidence_case_Data= ref<Evidence_case_data[]>([]);
const get_evidence_case_Data = (case_id:number) =>{
  case_evi_Views("" ,case_id).then(res=>{
    evidence_case_Data.value = res.data.data;
  })
}


//打印证据先行保存批准书
const create_evi_word = (row:any) =>{
  fetchData_case('',row.case_id).then(res=>{
    fetchData_mer('','','',res.data.data[0].mer_id).then(res1=>{
     create_case.mer_person = res1.data.data[0].mer_person;
  illegal_record_Search(row.case_id,row.evi_id_number).then(res2=>{
    create_case.illegal_behavior = res2.data.data[0].illegal_behavior;

  evi_Views(row.evi_id_number,row.case_id).then(res3=>{
    export_word_1(row.evi_id_number,
        res2.data.data[0].illegal_behavior,
        res1.data.data[0].mer_person,
        row.tce_time_year,
        row.tce_time_month,
        row.tce_time_day,
        create_case.mer_person, //执法人员1
        create_case.mer_person,//执法人员2
        row.tce_type_number,
        row.tce_number,
        row.tce_address,
        res3.data.data)
  });});});});
}
//打印喷码记录表
const create_inkjet_word = (row:any) =>{

  fetchData_case('',row.case_id).then(res=>{
    create_case.case_number = res.data.data.case_number
    fetchData_mer('','','',res.data.data.mer_id).then(res1=>{
      create_case.mer_person = res1.data.data.mer_name
    })
  });
  evi_Views(row.evi_id_number,row.case_id).then(res=>{
    export_word_2( create_case.evi_id_number,
        create_case.mer_person,
        row.tce_time_year,
        create_case.mer_person, //执法人员1
        // create_case.mer_person,//执法人员2
        row.tce_type_number,
        row.tce_amount,
        res.data.data)
  });
}
//打印立案报告表
const illegal_record_word = (case_id:number) =>{
  illegal_record_data(case_id).then(res=>{
    export_word_3(
        res.data.data.year,
        res.data.data.case_number,
        res.data.data.list1,
        res.data.data.case_source,
        res.data.data.month,
        res.data.data.day,
        res.data.data.hour,
        res.data.data.min,
        res.data.data.mer_address,
        res.data.data.mer_person,
        res.data.data.retail_licence_code,
        res.data.data.mer_id_number,
        res.data.data.mer_hometown,
        res.data.data.area_name,
        res.data.data.mer_name,
        res.data.data.list2,
        res.data.data.tce_type_number,
        res.data.data.tce_number,
        res.data.data.list3,
        res.data.data.year,
        res.data.data.month,
        res.data.data.day,
        res.data.data.year,
        res.data.data.month,
        res.data.data.day,
        res.data.data.year,
        res.data.data.month,
        res.data.data.day
    )
  })
}


interface Evidence_ciga_data {
  case_id:number,
  evi_number:number,
  ciga_variety:string,
  barcode:string,
  ciga_model:string,
  ciga_price:number,
  inkjet:string,
  evi_id_number:string,
}

const evidence_ciga_Data= ref<Evidence_ciga_data[]>([]);
//添加卷烟
const ciga_case_plus = () =>{
  ciga_evudence_Create(
      create_case.case_id,
      create_case.evi_number,
      create_case.ciga_variety,
      create_case.barcode,
      create_case.ciga_model,
      create_case.ciga_price,
      create_case.inkjet,
      create_case.evi_id_number,
  ).then(res=>{
    //alert(res.data)
    evidence_ciga_Data.value = res.data.data;
    //alert(evidence_case_Data)

    if (res.data.message ==="success"){
      ElMessage.success(`添加成功`);
    }else {
      ElMessageBox.confirm('添加失败', '提示', {
        type: 'warning'
      })
    }
  });
  create_case.barcode = '';
}
//核价表信息显示
const get_review_price_Data=(case_id:number)=>{
  evi_Views("",case_id).then(res=>{
    evidence_ciga_Data.value = res.data.data;

  })
}

//打印核价表信息
const review_price_word =(case_id:number) =>{
  illegal_record_data(case_id).then(res=>{
    export_word_5(
            res.data.data.year,
            res.data.data.case_number,
            res.data.data.list1,
            res.data.data.case_source,
            res.data.data.month,
            res.data.data.day,
            res.data.data.hour,
            res.data.data.min,
            res.data.data.mer_address,
            res.data.data.mer_person,
            res.data.data.retail_licence_code,
            res.data.data.mer_id_number,
            res.data.data.mer_hometown,
            res.data.data.area_name,
            res.data.data.mer_name,
            res.data.data.list2,
            res.data.data.tce_type_number,
            res.data.data.tce_number,
            res.data.data.list3,
            res.data.data.year,
            res.data.data.month,
            res.data.data.day,
            res.data.data.year,
            res.data.data.month,
            res.data.data.day,
            res.data.data.year,
            res.data.data.month,
            res.data.data.day
    )
  })
}
// const review_price_word =(row:any) =>{

// fetchData_case('',row.case_id).then(res=>{
//   create_case.case_number = res.data.data.case_number
//   fetchData_mer('','','',res.data.data.mer_id).then(res1=>{
//     create_case.mer_person = res1.data.data.mer_name
//   })
// });
// evi_Views(row.evi_id_number,row.case_id).then(res=>{
//   alert("2")
//   export_word_5(
//           //row.evi_id,
//           row.data.data.evi_id_number,
//           row.data.data.evi_number,
//           row.data.data.ciga_variety,
//           row.data.data.barcode,
//           row.data.data.ciga_model,
//           row.data.data.ciga_price,
//           row.data.data.inkjet,
//           row.data.data.list
//   )}
// )
// fetchData_case('',row.case_id).then(res=>{
//   fetchData_mer('','','',res.data.data[0].mer_id).then(res1=>{
//     create_case.mer_person = res1.data.data[0].mer_person;
// illegal_record_Search(row.case_id,row.evi_id_number).then(res2=>{
//   create_case.illegal_behavior = res2.data.data[0].illegal_behavior;
//
//         evi_Views(row.evi_id_number,row.case_id).then(res3=>{
//           export_word_5(row.evi_id_number,
//                   //res2.data.data[0].illegal_behavior,
//                   res1.data.data[0].mer_person,
//                   row.tce_time_year,
//                   row.tce_time_month,
//                   row.tce_time_day,
//                   create_case.mer_person, //执法人员1
//                   create_case.mer_person,//执法人员2
//                   row.tce_type_number,
//                   row.tce_number,
//                   row.tce_address,
//                   res3.data.data)
//         //});
//     });});});
// }

//询问笔录
// interface Inquiry_record_data{
//   tir_id:number,
//   case_number_id:number,
//   area_id:number,
//   tel:string,
//   photos_num:number,
//   tir_person:string,
//   tir_id_number:number,
//   tir_gender:string,
//   signature:string,
//   retail_licence_code:string,
//   time:string,
//   address:string,
//   area_principal:string,
//   prpb_num:string,
//   principal:string,
//   witness:string,
//   cigarette_varieties:string,
//   cigarettes_num:string,
//   specialist:string,
//   remark:string,
//   tce_address:string,
//   evi_id_number:string,
//   year:string,
//   ask_people:string,
//   enforcement_number:string,
//   recorder:string,
//   record_before_inquiry:string,
//   tir_age:string,
//   nation:string,
//   native_place:string,
//   family_address:string,
//   specific_business_location:string,
//   retail_licence_valid:string,
//   ciga_purchase_time:string,
//   statement_avoid_right:string,
//   asked_people_answer:string,
//   question_1:string,
//   answer_1:string,
//   question_2:string,
//   answer_2:string,
//   question_3:string,
//   answer_3:string,
//   question_4:string,
//   answer_4:string,
//   question_5:string,
//   answer_5:string,
//   question_6:string,
//   answer_6:string,
//   question_7:string,
//   answer_7:string,
//   question_8:string,
//   answer_8:string,
//   question_9:string,
//   answer_9:string,
//   question_10:string,
//   answer_10:string,
//   question_11:string,
//   answer_11:string,
//   question_12:string,
//   answer_12:string,
//   question_13:string,
//   answer_13:string,
//   question_14:string,
//   answer_14:string,
//   question_15:string,
//   answer_15:string,
//   end_question:string
// }
// //询问笔录显示
// const Inquiry_record_Data= ref<Inquiry_record_data[]>([]);
// const get_Inquiry_record_Data=(case_id:number)=>{
//   record_inquiry_show(case_id).then(res=>{
//     Inquiry_record_Data.value=res.data.data;
//   })
// }
// //询问笔录打印
// const inquiry_record_print = (case_id:number) =>{
//   record_inquiry_print(case_id).then(res=>{
//     export_word_6(
//             res.data.data.tir_id,
//             res.data.data.case_number_id,
//             res.data.data.area_id,
//             res.data.data.tel,
//             res.data.data.photos_num,
//             res.data.data.tir_person,
//             res.data.data.tir_id_number,
//             res.data.data.tir_gender,
//             res.data.data.signature,
//             res.data.data.retail_licence_code,
//             res.data.data.time,
//             res.data.data.address,
//             res.data.data.area_principal,
//             res.data.data.prpb_num,
//             res.data.data.principal,
//             res.data.data.witness,
//             res.data.data.cigarette_varieties,
//             res.data.data.cigarettes_num,
//             res.data.data.specialist,
//             res.data.data.remark,
//             res.data.data.tce_address,
//             res.data.data.evi_id_number,
//             res.data.data.year,
//             res.data.data.ask_people,
//             res.data.data.enforcement_number,
//             res.data.data.recorder,
//             res.data.data.record_before_inquiry,
//             res.data.data.tir_age,
//             res.data.data.nation,
//             res.data.data.native_place,
//             res.data.data.family_address,
//             res.data.data.specific_business_location,
//             res.data.data.retail_licence_valid,
//             res.data.data.ciga_purchase_time,
//             res.data.data.statement_avoid_right,
//             res.data.data.asked_people_answer,
//             res.data.data.question_1,
//             res.data.data.answer_1,
//             res.data.data.question_2,
//             res.data.data.answer_2,
//             res.data.data.question_3,
//             res.data.data.answer_3,
//             res.data.data.question_4,
//             res.data.data.answer_4,
//             res.data.data.question_5,
//             res.data.data.answer_5,
//             res.data.data.question_6,
//             res.data.data.answer_6,
//             res.data.data.question_7,
//             res.data.data.answer_7,
//             res.data.data.question_8,
//             res.data.data.answer_8,
//             res.data.data.question_9,
//             res.data.data.answer_9,
//             res.data.data.question_10,
//             res.data.data.answer_10,
//             res.data.data.question_11,
//             res.data.data.answer_11,
//             res.data.data.question_12,
//             res.data.data.answer_12,
//             res.data.data.question_13,
//             res.data.data.answer_13,
//             res.data.data.question_14,
//             res.data.data.answer_14,
//             res.data.data.question_15,
//             res.data.data.answer_15,
//             res.data.data.end_question,
//             res.data.data.list2,
//             res.data.data.tce_type_number
//     )
//   })
// }

//问答显示
interface Question_answer_data{
  id:number,
  case_id:number,
  question:string,
  answer:string
}
const question_answer_Data= ref<Question_answer_data[]>([]);
const get_question_answer_Data=(case_id:number)=>{
  question_answer_show(case_id).then(res=>{
    question_answer_Data.value = res.data.data;
  })
}
const question_answer_add=()=>{
  question_answer_Create(
          create_case.case_id,
          create_case.question,
          create_case.answer,
  ).then(res=>{
    if (create_case.answer.length==0 || create_case.answer.split(" ").join("").length==0 ||create_case.question.length==0){
      alert("问题或回答不能为空！")
    }else{
      question_answer_Data.value=res.data.data;
    }
    if (res.data.message ==="success"){
      ElMessage.success(`添加成功`);
    }else {
      ElMessageBox.confirm('添加失败', '提示', {
        type: 'warning'
      })
    }
  });
}
//问答

const question_answer_delete=(index:number,row:any)=>{
  // 二次确认删除
  ElMessageBox.confirm('确定要删除吗？', '提示', {
    type: 'warning'
  }).then(()=>{
    question_answer_clause_delete(row.id).then(res=>{
      if (res.data.message === "success"){
        question_answer_Data.value.splice(index, 1);
        ElMessage.success('删除成功');
      }else{
        ElMessageBox.confirm('删除失败', '提示', {
          type: 'warning'
        })
      }
    })
  })
          .catch(() => {});
}


interface End_record_data{
  case_source:string,
  case_number:string,
  date_of_filing:string,
  year:string,
  month:string,
  day:string,
  hour:string,
  min:string,
  mer_address:string,
  mer_person:string,
  mer_id_number:number,
  mer_hometown:string,
  mer_name:string,
  retail_license_code:string,
  area_name:string,
  tce_type_number:string,
  tce_number:string,
  illegal_behavior:string
  source_investigate:string,
  illegal_evidence:string,
  punish_basis:string,
  undertaker_opinion:string
}

const end_record_Data= ref<End_record_data[]>([]);
//调查终结文书显示
const get_end_record_Data=(case_id:number)=>{
  end_record_show(case_id).then(res=>{
    end_record_Data.value = res.data.data;
  })
}

//调查终结文书打印
const end_record_print = (case_id:number) =>{
  end_record_data(case_id).then(res=>{
    export_word_7(
        res.data.data.year,
        res.data.data.case_number,
        res.data.data.list1,
        res.data.data.case_source,
        res.data.data.month,
        res.data.data.day,
        res.data.data.hour,
        res.data.data.min,
        res.data.data.mer_address,
        res.data.data.mer_person,
        res.data.data.retail_licence_code,
        res.data.data.mer_id_number,
        res.data.data.mer_hometown,
        res.data.data.area_name,
        res.data.data.mer_name,
        res.data.data.list2,
        res.data.data.tce_type_number,
        res.data.data.tce_number,
        res.data.data.list3,
        // res.data.data.year,
        // res.data.data.month,
        // res.data.data.day,
        // res.data.data.year,
        // res.data.data.month,
        // res.data.data.day,
        // res.data.data.year,
        // res.data.data.month,
        // res.data.data.day,
        res.data.data.list4,
        res.data.data.list5,
        res.data.data.list6,
        res.data.data.list7,
        res.data.data.list8,
    )
  })
}


//继续添加案由并录入卷烟信息
const ciga_case_plus_1 = () =>{
  Case_legal_Visible.value=true;
  Case_cigrate_Visible.value=false;
  case_evi_create();
  evidence_ciga_Data.value = [];
  // create_case.tcs_note = "涉案卷烟信息录入已完成"
  // fetchData_case_update(create_case.case_id,create_case.tcs_note)
}



//卷烟之后进行下一步（证据采集）
const ciga_case_plus_2 = () =>{
  Evidence_collection_Visible.value=true;
  Case_cigrate_Visible.value=false;
  case_evi_create();
  evidence_ciga_Data.value = [];
  create_case.tcs_note = "涉案卷烟信息录入已完成"
  fetchData_case_update(create_case.case_id,create_case.tcs_note)
}
//确定并退出
const ciga_case_plus_3 = () =>{
  Case_cigrate_Visible.value=false;
  case_evi_create();
  evidence_ciga_Data.value = [];
  create_case.tcs_note = "涉案卷烟信息录入已完成"
  fetchData_case_update(create_case.case_id,create_case.tcs_note)
}

const case_evi_create = () =>{
  case_evi_Create(create_case.evi_id_number, create_case.case_id,create_case.tce_remark,create_case.tce_address).then(
      res=>{
        if (res.data.message ==="success"){
        ElMessage.success(`添加成功`);
      }else {
        ElMessageBox.confirm('添加失败', '提示', {
          type: 'warning'
        })
      }
      }
  )
}
//创建送检信息
const staff_evi_create=()=>{
  staff_evidence_create(
      create_case.case_id,
      create_case.staff_evi_send_per,
      create_case.staff_evi_check_per1,
      create_case.staff_evi_check_per2,
      create_case.staff_evi_send_time,
      create_case.staff_evi_send_unit,
      create_case.staff_evi_send_result,
      create_case.staff_evi_rec_address,
      create_case.staff_evi_status,
      create_case.staff_evi_per_note,
)
}

const staff_evi_create_print = () =>{
  staff_evi_create();
  staff_evidence_data(create_case.case_id).then(res=>{
    export_word_4(
        res.data.data.year,
        res.data.data.staff_evi_send_unit,
        res.data.data.staff_evi_send_per,
        res.data.data.staff_evi_send_result,
        res.data.data.staff_evi_check_per1,
        res.data.data.staff_evi_check_per2,
        res.data.data.staff_evi_per_note,
        res.data.data.case_source,
        res.data.data.month,
        res.data.data.day,
        res.data.data.hour,
        res.data.data.mer_address,
        res.data.data.mer_person,
        res.data.data.retail_licence_code,
        res.data.data.mer_id_number,
        res.data.data.mer_hometown,
        res.data.data.area_name,
        res.data.data.mer_name,
        res.data.data.list2,
        res.data.data.tce_type_number,
        res.data.data.tce_number,
        res.data.data.list3,
        res.data.data.year1,
        res.data.data.month1,
        res.data.data.day1,
        res.data.data.year2,
        res.data.data.month2,
        res.data.data.day2,
    );
  })
}


//列表中的按钮
//涉案卷烟信息录入按钮
const case_legal_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  create_case.case_number = row.case_number;
  create_case.ciga_flag = row.ciga_flag;
  create_case.ciga_num_flag = row.ciga_num_flag;
  Case_legal_Visible.value = true;
}
//证据采集按钮
const evidence_collection_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  create_case.case_number = row.case_number;
  create_case.ciga_flag = row.ciga_flag;
  create_case.ciga_num_flag = row.ciga_num_flag;
  Evidence_collection_Visible.value = true;
}
//证据先行保存通知书按钮
const ratification_tabel = (row:any) =>{
  get_evidence_case_Data(create_case.case_id);

  create_case.case_id = row.case_id;
  create_case.ciga_flag = row.ciga_flag;
  create_case.ciga_num_flag = row.ciga_num_flag;
  Ratification_Visible.value = true;
  Evidence_collection_Visible.value = false;

}
//证据先行保存批准书审核
const ratification_review_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  create_case.ciga_flag = row.ciga_flag;
  create_case.ciga_num_flag = row.ciga_num_flag;
  get_evidence_case_Data(create_case.case_id);
  Ratification_review_Visible.value = true;
  Ratification_Visible.value = false;

}
//证据先行保存通知书上传
const advice_note_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  create_case.ciga_flag = row.ciga_flag;
  create_case.ciga_num_flag = row.ciga_num_flag;
  Advice_note_Visible.value = true;
  Ratification_review_Visible.value = false;
}
//现场勘验笔录按钮
const inspection_record_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  create_case.ciga_num_flag = row.ciga_num_flag;
  get_evidence_case_Data(create_case.case_id);
  Inspection_record_Visible.value = true;
  Advice_note_Visible.value = false;
}
//喷码记录表按钮
const printing_record_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  create_case.ciga_num_flag = row.ciga_num_flag;
  get_evidence_case_Data(create_case.case_id);
  Printing_record_Visible.value = true;
  Inspection_record_Visible.value = false;
}
//立案报表按钮
const filing_Report_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  get_evidence_case_Data(create_case.case_id);
  Filing_Report_Visible.value = true;
  Printing_record_Visible.value = false;
  Inspection_record_Visible.value = false;
}
//立案报表审核按钮
const filing_Report_review_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  get_evidence_case_Data(create_case.case_id);
  Filing_Report_review_Visible.value = true;
  Filing_Report_Visible.value = false;
}
//卷烟鉴别书按钮
const cigarette_identification_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  get_staff_opinion1();
  get_evidence_case_Data(create_case.case_id);
  Cigarette_identification_Visible.value = true;
  Filing_Report_review_Visible.value = false;
}
//核价表按钮
const price_list_tabel = (row:any) =>{
  create_case.case_id=row.case_id
  get_review_price_Data(create_case.case_id);
  Price_list_Visible.value = true;
  Cigarette_identification_Visible.value = false;
  Filing_Report_review_Visible.value = false;
}
//询问笔录按钮
const cranscript_of_questioning_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  get_question_answer_Data(create_case.case_id);
  Transcript_of_questioning_Visible.value = true;
  Price_list_Visible.value = false;
}
//无证经营许可证按钮
const without_license_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  get_evidence_case_Data(create_case.case_id);
  Without_license_Visible.value = true;
  Transcript_of_questioning_Visible.value = false;
}
//调查终结文书按钮
const end_document_tabel = (row:any) =>{
  create_case.case_id = row.case_id;
  get_evidence_case_Data(create_case.case_id);
  End_document_Visible.value = true;
  Without_license_Visible.value = false;
}


//证据保存批准书按钮
const ratification = () =>{
  Ratification_Visible.value = true;
  Evidence_collection_Visible.value = false;
  get_evidence_case_Data(create_case.case_id);
  create_case.tcs_note = "涉案卷烟信息录入已完成"
  fetchData_case_update(create_case.case_id,create_case.tcs_note)
}
//证据保存批准书审核按钮
const ratification_review = () =>{
  Ratification_review_Visible.value = true;
  Ratification_Visible.value = false;
  get_evidence_case_Data(create_case.case_id);
}
//证据保存通知书上传按钮
const advice_note = () =>{
  Advice_note_Visible.value = true;
  Ratification_review_Visible.value = false;
}
//现场勘验笔录按钮
const inspection_record = () =>{
  Inspection_record_Visible.value = true;
  Advice_note_Visible.value = false;
}
//喷码记录表按钮
const printing_record = () =>{
  Printing_record_Visible.value = true;
  Inspection_record_Visible.value = false;
}
//立案报表按钮
const filing_Report = () =>{
  Filing_Report_Visible.value = true;
  Printing_record_Visible.value = false;
  Inspection_record_Visible.value = false;
}
//立案报表审核按钮
const filing_Report_review = () =>{
  Filing_Report_review_Visible.value = true;
  Filing_Report_Visible.value = false;
}
//卷烟鉴别书按钮
const cigarette_identification = () =>{
  get_staff_opinion1();
  Cigarette_identification_Visible.value = true;
  Filing_Report_review_Visible.value = false;
}
//核价表按钮
const price_list = () =>{
  Price_list_Visible.value = true;
  get_review_price_Data(create_case.case_id);
  Cigarette_identification_Visible.value = false;
  Filing_Report_review_Visible.value = false;

}
//询问笔录按钮
const cranscript_of_questioning = () =>{
  Transcript_of_questioning_Visible.value = true;
  get_question_answer_Data(create_case.case_id);
  Price_list_Visible.value = false;
}
//无证经营许可证按钮
const without_license= () =>{
  Without_license_Visible.value = true;
  Transcript_of_questioning_Visible.value = false;
}
//调查终结文书按钮
const end_document = () =>{
  End_document_Visible.value = true;
  get_end_record_Data(create_case.case_id);
  Without_license_Visible.value = false;
}
//终结案件按钮
const end = () =>{
  End_document_Visible.value = false;
}


const query = reactive({
  id:'',
  name_case: '',
  pageIndex: 1,
  pageSize: 10
});
const tableData = ref<TableItem[]>([]);
const tableList = ref<TableItem[]>([]); // 用于存放分页数据的列表
const pageTotal = ref(0);
// 获取表格数据
const getData = (archive_person:string='',case_id:number,case_source:string='',case_type:string='') => {
	fetchData_case(archive_person,case_id,case_source,case_type).then(res => {
    tableList.value = [];
		tableData.value = res.data.data;
		pageTotal.value = res.data.data.length ;
    // 根据页码确定下标位置
    const index: number = query.pageIndex * query.pageSize - query.pageSize;
    for (let i = index; i < index + query.pageSize; i++) {
      // 防止数组下标越界
      if (i <= tableData.value.length - 1) {
        tableList.value.push(tableData.value[i])
      } else {
        // 越界就不再循环
        break;
      }
    }
	});
};
getData();

// 分页导航
const handlePageChange = (val: number) => {
  query.pageIndex = val;
  getData();
};

// 删除操作
const handleDelete = (index: number) => {
  // 二次确认删除
  ElMessageBox.confirm('确定要删除吗？', '提示', {
    type: 'warning'
  })
      .then(() => {
        ElMessage.success('删除成功');
        tableData.value.splice(index, 1);
      })
      .catch(() => {});
};


// 查询操作
const handleSearch = () => {
  let  id = query.id;
  query.pageIndex = 1;
  getData();
};
// 表格编辑时弹窗和保存
const editVisible = ref(false);
let form = reactive({
  shop_name: '',
  name_case: ''
});
let idx: number = -1;
const handleEdit = (index: number, row: any) => {
  idx = index;
  form.shop_name = row.shop_name;
  form.name_case = row.name_case;
  editVisible.value = true;
};
</script>

<style scoped>
.handle-box {
	margin-bottom: 20px;
}

.handle-select {
	width: 120px;
}

.handle-input {
	width: 300px;
}
.table {
	width: 100%;
	font-size: 14px;
}
.red {
	color: #ff0000;
}
:deep(.el-upload--picture-card) {
  width: 100px;
  height: 100px;
}
:deep(.el-upload) {
  width: 200px;
  height: 200px;
  line-height: 100px;
}
:deep(.el-upload-list--picture-card) .el-upload-list__item{
  width: 100px;
  height: 100px;
  line-height: 100px;
}
:deep(.el-upload-list--picture-card)  .el-upload-list__item-thumbnail{
  width: 100px;
  height: 100px;
  line-height: 100px;
}
:deep(.avatar){
  width: 100px;
  height: 100px;
}
.blue {
  color: rgba(0, 118, 252, 0.79);
}
.mr10 {
	margin-right: 10px;
}
.table-td-thumb {
	display: block;
	margin: auto;
	width: 40px;
	height: 40px;
}
.handle-box button{
  background-color: #00a854;
}

</style>
